//
//  String+Extension.swift
//  Weibo
//
//  Created by 贵永冬 on 16/7/17.
//  Copyright © 2016年 贵永冬. All rights reserved.
//

import Foundation
import UIKit

extension String {
    public func sizeWithString( font: UIFont, size: CGSize) -> CGSize {
        let str: NSString = (self as NSString)
        let rect = str.boundingRectWithSize(size, options: [NSStringDrawingOptions.UsesLineFragmentOrigin,NSStringDrawingOptions.UsesFontLeading], attributes: [NSFontAttributeName:font], context: nil)
        return rect.size
    }
}